layui.use('layer', function(){ //独立版的layer无需执行这一句
    var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
    //触发事件
    var active = {
        offset: function(){
            layer.open({
                title : false,
                type: 1
                ,content:  '<div class="admin-header-lock" id="lock-box">'+
                    '<div class="input_btn">'+
                    '<input type="password" class="admin-header-lock-input layui-input" autocomplete="off" placeholder="请输入密码解锁.." name="lockPwd" id="lockPwd" />'+
                    '</div>'+
                    '<p>请输入“123456”，否则不会解锁成功哦！！！</p>'+
                    '</div>'
                , closeBtn : 0
                ,btn:'临时解锁'
                ,shade: 0.9 //显示遮罩
                ,yes: function(){
                    var closeContext=top.$('#lockPwd').val();
                    if (closeContext==""){
                        alert("请输入密码！");
                    } else if (closeContext!="123456"){
                        alert("密码不正确！");
                    }else if (closeContext=="123456"){
                        layer.close(layer.index);
                    }
                }
            });
        }
    };
    $('.lock').on('click', function(){
        var othis = $(this), method = othis.data('method');
        active[method] ? active[method].call(this, othis) : '';
    });
});